package com.ruoyi.activity.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.activity.mapper.TbActivityConfigMapper;
import com.ruoyi.activity.domain.TbActivityConfig;
import com.ruoyi.activity.service.ITbActivityConfigService;

/**
 * 活动设置Service业务层处理
 * 
 * @author jll
 * @date 2025-06-13
 */
@Service
public class TbActivityConfigServiceImpl implements ITbActivityConfigService 
{
    @Autowired
    private TbActivityConfigMapper tbActivityConfigMapper;

    /**
     * 查询活动设置
     * 
     * @param id 活动设置主键
     * @return 活动设置
     */
    @Override
    public TbActivityConfig selectTbActivityConfigById(Long id)
    {
        return tbActivityConfigMapper.selectTbActivityConfigById(id);
    }

    /**
     * 查询活动设置列表
     * 
     * @param tbActivityConfig 活动设置
     * @return 活动设置
     */
    @Override
    public List<TbActivityConfig> selectTbActivityConfigList(TbActivityConfig tbActivityConfig)
    {
        return tbActivityConfigMapper.selectTbActivityConfigList(tbActivityConfig);
    }

    /**
     * 新增活动设置
     * 
     * @param tbActivityConfig 活动设置
     * @return 结果
     */
    @Override
    public int insertTbActivityConfig(TbActivityConfig tbActivityConfig)
    {
        tbActivityConfig.setCreateTime(DateUtils.getNowDate());
        return tbActivityConfigMapper.insertTbActivityConfig(tbActivityConfig);
    }

    /**
     * 修改活动设置
     * 
     * @param tbActivityConfig 活动设置
     * @return 结果
     */
    @Override
    public int updateTbActivityConfig(TbActivityConfig tbActivityConfig)
    {
        tbActivityConfig.setUpdateTime(DateUtils.getNowDate());
        return tbActivityConfigMapper.updateTbActivityConfig(tbActivityConfig);
    }

    /**
     * 批量删除活动设置
     * 
     * @param ids 需要删除的活动设置主键
     * @return 结果
     */
    @Override
    public int deleteTbActivityConfigByIds(Long[] ids)
    {
        return tbActivityConfigMapper.deleteTbActivityConfigByIds(ids);
    }

    /**
     * 删除活动设置信息
     * 
     * @param id 活动设置主键
     * @return 结果
     */
    @Override
    public int deleteTbActivityConfigById(Long id)
    {
        return tbActivityConfigMapper.deleteTbActivityConfigById(id);
    }
}
